home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / system / switchar.zip / SWITCHAR.C < prev    next >
Text File  |  1988-07-10  |  512b  |  26 lines

  1. #include <stdio.h>
  2. #include <dos.h>
  3.  
  4. #define dos_function 0x37
  5. #define read_switch_character 0
  6. #define write_switch_character 1
  7.  
  8. main(int argc,char *argv[])
  9. {
  10.     union REGS in_regs,out_regs;
  11.  
  12.     in_regs.h.ah = dos_function;
  13.     if (argc == 2)
  14.     {
  15.         in_regs.h.al = write_switch_character;
  16.         in_regs.h.dl = *argv[1];
  17.     }
  18.     else
  19.         in_regs.h.al = read_switch_character;
  20.     intdos(&in_regs,&out_regs);
  21.     fputs("switch character: ",stderr);
  22.     fputc(out_regs.h.dl,stderr);
  23.     fputc('\n',stderr);
  24. }
  25.     
  26.